package com.yanq.liancar.adapter;
/*
 *  @创建者     Administrator
 *  @创建时间   2018/10/9  10:59
 *  @描述       ${TODO}
 */


import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yanq.liancar.R;
import com.yanq.liancar.bean.DialogAdapterBean;

import java.util.List;

public class DialogAdapter1 extends BaseQuickAdapter<DialogAdapterBean.DataBean,BaseViewHolder> {
    public DialogAdapter1(int layoutResId, @Nullable List<DialogAdapterBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, DialogAdapterBean.DataBean item) {
        helper.setText(R.id.tv_content,item.getName());
        TextView textView=helper.getView(R.id.tv_content);
        ImageView imageView=helper.getView(R.id.img_duihao);
        if (item.isIsCheck()){
            textView.setTextColor(mContext.getResources().getColor(R.color.main_color));
            imageView.setVisibility(View.VISIBLE);
        }else {
            textView.setTextColor(mContext.getResources().getColor(R.color.background_content));
            imageView.setVisibility(View.GONE);
        }
    }
}
